package cn.jinjimi.base.util;

import android.text.TextUtils;

/**
 * Created by Roy
 * Date: 16/1/8
 */
public enum SharePlatForm {
    WEIXIN("weixin"),
    WEIXIN_CIRCLE("weixin_circle"),
    QQ("qq"),
    QZONE("qzone"),
    SMS("sms"),
    COPYLINK("copylink");

    public final static int WEIXIN_INDEX = 0;
    public final static int WEIXIN_CIRCLE_INDEX = 1;
    public final static int QQ_INDEX = 2;
    public final static int QZONE_INDEX = 3;
    public final static int SMS_INDEX = 4;
    public final static int COPYLINK_INDEX = 5;


    private String a;

    public static SharePlatForm convertToEmun(String var0) {
        if (TextUtils.isEmpty(var0)) {
            return null;
        } else if (var0.equals("wxtimeline")) {
            return WEIXIN_CIRCLE;
        } else if (var0.equals("wxsession")) {
            return WEIXIN;
        } else {
            SharePlatForm[] var1 = values();
            int var4 = var1.length;

            for (int var3 = 0; var3 < var4; ++var3) {
                SharePlatForm var2 = var1[var3];
                if (var2.toString().trim().equals(var0)) {
                    return var2;
                }
            }

            return null;
        }
    }

    SharePlatForm(String var3) {
        this.a = var3;
    }

    public String toString() {
        return this.a;
    }

    public boolean isCustomPlatform() {
        return true;
    }

    public boolean isSupportAuthorization() {
        return false;
    }

    public int getReqCode() {
        return 0;
    }

    public static SharePlatForm[] getDefaultPlatform() {
        return new SharePlatForm[]{WEIXIN_CIRCLE, WEIXIN, QQ, QZONE, COPYLINK};
    }

    public static SharePlatForm[] getShareAllPlatforms() {
        return new SharePlatForm[]{WEIXIN_CIRCLE, WEIXIN, QQ, QZONE};
    }

    public static SharePlatForm[] getShareMultiPlatforms() {
        return new SharePlatForm[]{WEIXIN_CIRCLE, WEIXIN, QQ};
    }

    public static SharePlatForm[] getShareWeiXinPlatForms() {
        return new SharePlatForm[]{WEIXIN_CIRCLE, WEIXIN};
    }

}
